import { Modal } from 'antd';
import { ReactNode } from 'react';

type Porps = {
  title: string;
  dialogStatus: boolean;
  render: () => ReactNode;
  setDialogStatus: (val: boolean) => void;
  width: number;
  className: string;
};
const Dialog = ({ title, dialogStatus, render, setDialogStatus, width = 600, className = '' }: Porps) => {
  return (
    <Modal
      width={width}
      className={className}
      destroyOnClose={true}
      centered={true}
      title={title}
      visible={dialogStatus}
      onCancel={() => setDialogStatus(false)}
      footer={null}
    >
      {render()}
    </Modal>
  );
};

export default Dialog;
